<template>
  <div class="container">
    <div class="header">
      <div class="headerOne">
        <div class="topOne">
          <div
            class="selection"
            @click="location.href = ' http://www.baidu.com'"
          >
            <span>上海</span>
            <i>▼</i>
          </div>
          <div class="inp">
            <i>☢</i>
            <span>请输入小区或地址</span>
          </div>
        </div>
        <div class="swiper">
          <img
            :src="'http://www.xiaoshuaipeng.com:8080' + imgList[0].imgSrc"
            alt=""
          />
        </div>
      </div>
    </div>
    <div class="main">
      <div class="classfiy">
        <div class="kuai">
          <div class="yuan">
            <i>✈</i>
          </div>
          <p>整租</p>
        </div>
        <div class="kuai">
          <div class="yuan">
            <i>✈</i>
          </div>
          <p>整租</p>
        </div>
        <div class="kuai">
          <div class="yuan">
            <i>✈</i>
          </div>
          <p>整租</p>
        </div>
        <div class="kuai">
          <div class="yuan">
            <i>✈</i>
          </div>
          <p>整租</p>
        </div>
      </div>
      <!-- 资讯 -->
      <div class="information"></div>
      <!-- 内容 -->
      <Inform></Inform>
    </div>
  </div>
</template>

<script>
import axios from "axios";
import Inform from "@/components/Inform.vue";
export default {
  name: "IndexShou",
  components: {
    Inform,
  },
  data() {
    return {
      imgList: [],
      area: [],
    };
  },
  async created() {
    // 轮播图
    this.lun();
    // 资讯
    this.zix();
  },
  methods: {
    async lun() {
      const res = await axios.get(
        "http://www.xiaoshuaipeng.com:8080/home/swiper"
      );
      // console.log(res.data.body[0].imgSrc);
      this.imgList = res.data.body;
    },
  },
};
</script>

<style scoped lang="less">
.header {
  .headerOne {
    position: relative;
    .topOne {
      position: absolute;
      display: flex;
      height: 30px;
      line-height: 30px;
      padding: 10px;
      .selection {
        background-color: #fff;
      }
      .inp {
        width: 240px;
        background-color: #fff;
      }
    }
    .swiper {
      img {
        width: 100vw !important;
      }
    }
  }
}

.main {
  margin-bottom: 50px;
  .classfiy {
    height: 94px;
    background-color: #fff;
    display: flex;
    justify-content: space-evenly;
    align-content: center;
    .kuai {
      width: 20%;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      align-items: center;
      .yuan {
        width: 48px;
        height: 48px;
        text-align: center;
        line-height: 48px;
        background-color: #24ff74;
        border-radius: 50%;
      }
    }
  }
}
</style>
